/*
 * @Author: hej 1723204848@qq.com
 * @Date: 2023-06-24 21:48:22
 * @LastEditors: Heyong
 * @LastEditTime: 2023-11-24 15:54:05
 * @FilePath: \JY-H5-APP\src\setupProxy.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// javascript

const { createProxyMiddleware } = require("http-proxy-middleware");

module.exports = function (app) {
  app.use(
    createProxyMiddleware("/app", {
      target: "http://10.13.124.80:18080",
      // target: "http://10.0.204.9:80",
      changeOrigin: true,
      pathRewrite: { "^/app": "" },
    }),
    createProxyMiddleware("/api", {
      target: "http://10.13.124.80:18003",
      // target: 'http://10.0.204.9:18003',
      changeOrigin: true,
      pathRewrite: { "^/api": "" },
    }),
    createProxyMiddleware("/commuite", {
      target: "http://10.13.124.91:4005",
      changeOrigin: true,
      pathRewrite: { "^/commuite": "" },
    })
    // createProxyMiddleware('/iot', {
    //     target: 'http://10.0.204.9:80',
    //     changeOrigin: true,
    //     pathRewrite: { "^/iot": "" }
    // }),
  );
};
